package loop;

import java.sql.SQLOutput;
import java.util.Scanner;

public class Demo6 {
    public static void main(String[] args) {
        int score = 0;
        for (int i = 0; i < 10; i++) {
            int romdom1 = (int) (Math.random() * 100);
            int romdom2 = (int) (Math.random() * 100);
            int addend;
            int augend;
            int sum = 0;
            addend = romdom1;
            augend = romdom2;
            sum = addend + augend;
            System.out.println(addend + "+" + augend + "=");
            System.out.print("请输入答案:");
            Scanner sc = new Scanner(System.in);
            int value = sc.nextInt();
            if (value == sum) {
                score += 10;
                System.out.println("Correct score="+score);

            } else
                System.out.println("Error");
        }
        System.out.println("总分"+score);
    }
}